﻿// -----------------------------------------------------------------------
// <copyright file="INPContainer.cs" company="Accenture">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace NPSoft.Ferrero.Framework.Crosscutting
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Practices.Unity.InterceptionExtension;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public interface INPContainer
    {
        /// <summary>
        /// 解析类型。
        /// </summary>
        /// <typeparam name="T">源类型</typeparam>
        /// <returns>目标类型</returns>
        T Resolve<T>();

        /// <summary>
        /// 注册类型。
        /// </summary>
        /// <typeparam name="TFrom">源类型</typeparam>
        /// <typeparam name="TTo">目标类型</typeparam>
        void RegisterType<TFrom, TTo>() where TTo : TFrom;

        /// <summary>
        /// 拦截接口。
        /// </summary>
        /// <typeparam name="TFrom">接口类型</typeparam>
        /// <typeparam name="TTo">处理类型</typeparam>
        /// <typeparam name="TBehavior">拦截类型</param>
        void SetDefaultInterceptorFor<TFrom, TTo, TBehavior>()
            where TTo : TFrom
            where TBehavior : IInterceptionBehavior;
    }
}
